home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
14439
/
14439.xpi
/
chrome
/
tabber.jar
/
content
/
settings.js
< prev
next >
Wrap
Text File
|
2009-10-25
|
3KB
|
102 lines
var cb;
window.addEventListener("load", function() {
var ai = Components.classes["@mozilla.org/xre/app-info;1"];
var version = ai.getService(Components.interfaces.nsIXULAppInfo).version;
if(version.indexOf("3.5") == 0)
$("fx36").hidden = true;
else {
$("fx35").label = $("always").label;
var o = $("fx35").parentNode.removeChild($("fx35"));
$("always").parentNode.replaceChild(o, $("always"));
$("links").addEventListener("command", function() {
if($("links").checked) $("fx35").checked = false;
}, false);
$("fx35").addEventListener("command", function() {
if($("fx35").checked) $("links").checked = false;
}, false);
}
var os = ai.getService(Components.interfaces.nsIXULRuntime).OS;
if(os == "Darwin") {
var k = document.getElementsByClassName("key");
for(var i = 0; i < k.length; i++)
k[i].label = k[i].label.replace(/Ctrl/, "Cmd");
$("alt").value = $("alt").value.replace(/Alt/, "Opt");
}
if($("open_newwindow").value != 3) {
$("script").hidden = true;
$("owner").hidden = true;
}
else {
$("script").checked = $("restriction").value == 0;
$("script").addEventListener("command", function() {
$("restriction").value = $("script").checked ? 0 : 2;
}, false);
}
ownerOnClose();
tabClipWidth();
multiRowTabs();
tabMaxWidth();
$("select").addEventListener("command", ownerOnClose, false);
$("button").addEventListener("command", tabClipWidth, false);
$("tabbar").addEventListener("command", multiRowTabs, false);
$("min").addEventListener("change", tabMaxWidth, false);
$("max").addEventListener("change", tabMaxWidth, false);
cb = $("button").selectedIndex + 0;
var i = cb != 2;
if(cb == 2) cb = 1;
$("close").checked = i;
$("noclose").hidden = i;
if(!i) $("button").selectedIndex = 2;
$("button").disabled = !i;
$("close").addEventListener("command", closeButtons, false);
window.addEventListener("beforeaccept", function() {
var b = $("button").selectedIndex + 0;
$("button").parentNode.removeChild($("button"));
$("closeButtons").value = b;
}, false);
sizeToContent();
}, false);
function $(id) {
return document.getElementById(id);
}
function ownerOnClose() {
var i = $("select").selectedIndex != 0;
if(i) $("owner").checked = false;
$("owner").disabled = i;
}
function tabClipWidth() {
var i = $("button").selectedIndex == 1;
$("clip").hidden = !i;
$("px").hidden = !i;
}
function multiRowTabs() {
$("multi").disabled = !$("tabbar").checked;
}
function tabMaxWidth() {
if(parseInt($("min").value) > parseInt($("max").value))
$("max").value = $("min").value;
}
function closeButtons() {
var i = $("close").checked;
if(!i) cb = $("button").selectedIndex + 0;
$("noclose").hidden = i;
$("button").disabled = false;
$("button").selectedIndex = i ? cb : 2;
$("button").disabled = !i;
tabClipWidth();
}